-- husky
-- created by panyl
-- 召唤兽：哈士奇

return {
    fetchInitData = function(classId)
        -- 根据楼层计算
        local dungeonId = DungeonM.getDungeonId();
        local layerFix  = DungeonAreaM.query(dungeonId, "layer_fix");
        local layer     = DungeonM.currentLayer();
        if layer > 80 then
            layer = math.modf(layer * 0.85 + 12)
        end

        -- 生命、攻击系数
        local dbase = SummonM.query(classId, "dbase");
        local hpCoef = dbase["hp_coef"] or 0;
        local attackCoef = dbase["attack_coef"] or 0;

        local hp = FormulaM.invoke("CALC_DUNGEON_MONSTER_INIT_HP", hpCoef, layer, layerFix);
        local attack = FormulaM.invoke("CALC_DUNGEON_MONSTER_INIT_ATTACK", attackCoef, layer, layerFix);
        
        hp = math.min(hp, 9999);
        attack = math.min(attack, 999);
        
        return {
            ["hp"] = hp,
            ["max_hp"] = hp,
            ["attack"] = attack,
        };
    end,
};
